<?php
class Backoffice_Model_FormPrivilege extends CC_Backoffice_Form
{
    /** @var Doctrine\ORM\EntityManager */
    protected $_em;
    
    public function __construct($options = null, Doctrine\ORM\EntityManager $em = null)
    {
        parent::__construct($options);
        $this->_em = $em;
        
        $this->setMethod('post');
        
        $name = new Zend_Form_Element_Text('name');
        $name->setAttrib('size', 28)
             ->setLabel("Name")
             ->setRequired(true)
             ->addErrorMessage("A name is required");
        
        $description = new Zend_Form_Element_Text('description');
        $description->setAttrib('size', 28)
                    ->setLabel('Description')
                    ->setRequired(true)
                    ->addErrorMessage("A description is required");

        $flag = new CC_Form_FlagSelect('flag', $this->_em);
        $flag->setLabel("Flag")
             ->setRequired(true)
             ->addErrorMessage("A flag is required");
                    
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel("Create Privilege");

        $this->addElements(array($name, $description, $flag, $submit));
        
    }
}
?>